{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "base_directory = \"/home/jovyan/work/data/lrs2\"\n",
    "data_dir = base_directory +\"mvlrs_v1/\"\n",
    "main_dir = data_dir + \"main/\"\n",
    "pretrain_dir = data_dir+ \"pretrain/\"\n",
    "print(len(os.listdir(main_dir))) #3738 folders in the main directory\n",
    "print(len(os.listdir(pretrain_dir))) #3512 folders in the pretrain directory\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "len = 0\n",
    "for i in os.listdir(main_dir):\n",
    "    path = main_dir + \"f{i}/\"\n",
    "    files = [f for f in os.listdir(path) if f.endswith(\"*.txt\")]\n",
    "    files_length = len(files)\n",
    "    len +=files_length\n",
    "print(f\"total .txt files in the main dir is {len}\")\n",
    "\n"
   ]
  }
 ],
 "metadata": {
  "language_info": {
   "name": "python"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
